#ifndef  FILESEEK_H
#define FILESEEK_H

#include "wmdf_file.h"
#include <string>

using namespace std;

namespace xml_api 
{

class FileSeek
{
public:
	virtual ~FileSeek(void);
public:
	virtual bool SetPos(long newPos) = 0;
	virtual bool GetPos(long &pos) = 0;
	virtual bool SeekToPos(long offset, SeekMode origin) = 0;
	virtual bool SeekToEnd() = 0;
	virtual bool SeekToBegin() = 0;
	virtual bool SeekFromCurrent(long offset) = 0;
	virtual bool SeekFromBegin(long offset) = 0;
	virtual bool SeekFromEnd(long offset) = 0;
	virtual bool IsEndofFile() = 0;
};

class BinFileSeek: virtual public FileSeek
{
public:
	BinFileSeek(string& Path);
	BinFileSeek(WMDFFile* pFile);
	virtual ~BinFileSeek(void);
protected:
	WMDFFile* m_File;
private:
	bool m_NeedFreeFile;
public:
	virtual bool SetPos(long newPos);
	virtual bool GetPos(long &pos);
	virtual bool SeekToPos(long offset, SeekMode origin);
	virtual bool SeekToEnd();
	virtual bool SeekToBegin();
	virtual bool SeekFromCurrent(long offset);
	virtual bool SeekFromBegin(long offset);
	virtual bool SeekFromEnd(long offset);
	virtual bool IsEndofFile();
};

}

#endif